package st.business.tepth.business.user.busnumber.workholder.maintain.pass;

import java.util.ArrayList;
import java.util.List;

import st.business.tepth.business.bean.MaintainPassInfoBean;
import st.business.tepth.config.ItemFields;
import st.shadow.library.ui.recycler.MultipleItemEntity;

/**
 * @author zhangyu
 * @date 2019/4/19
 */
public class MaintainPassDataConvert {
    public static List<MultipleItemEntity> convertClassification(List<MaintainPassInfoBean> list) {
        List<MultipleItemEntity> multipleItemEntities = new ArrayList<>();
        if(list != null) {
            for (int i = 0, size = list.size(); i < size; i++) {
                multipleItemEntities.add(MultipleItemEntity.builder()
                        .setField(ItemFields.ITEM_OBJ, list.get(i))
                        .setField("isChecked", false)
                        .setField("isSelected", i == 0)
                        .build());
            }
        }
        return multipleItemEntities;
    }
}
